package com.czy.owner.ui.store.storeviewholder;


import android.content.Context;
import android.view.ViewGroup;
import android.widget.TextView;

import com.czy.owner.R;
import com.czy.owner.entity.StoreActivityModel;
import com.czy.owner.utils.TimeUtils;
import com.easyrecycleview.adapter.BaseViewHolder;


/**
 * Created wangyang on 2016/9/21.
 */
public class StoreTvDefaultViewHolder extends BaseViewHolder<StoreActivityModel.StoreList> {
    private TextView tv_Title;
    private TextView tv_Content;
    private TextView tv_Time;
    private Context ctx;

    public StoreTvDefaultViewHolder(ViewGroup parent, Context ctx) {
        super(parent, R.layout.item_store_type_tvdefault);
        tv_Title = $(R.id.tv_title);
        tv_Content = $(R.id.tv_content);
        tv_Time = $(R.id.tv_time);
        this.ctx = ctx;
    }

    @Override
    public void setData(StoreActivityModel.StoreList model) {
        super.setData(model);
        try{
            tv_Title.setText(model.getTitle());
            tv_Content.setText(model.getContent());
            String time = TimeUtils.formatTimeDifference2(Long.parseLong(model.getCreateTime()));
            tv_Time.setText(time);
        }catch (Exception e){

        }



    }
}

